﻿<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<title>登录</title>
<link rel="shortcut icon" href="favicon.ico">
<link href="js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/login.css" rel="stylesheet">
<script src="js/page-login/jquery.min.1.11.1.js"></script>
<script src="js/page-login/jquery-form.js"></script>
<script src="js/page-login/sr_md5.js"></script>
</head>
<body class="templatemo-bg-gray">
	<div class="container">
		<div class="col-md-12">
			<h1 class="margin-bottom-15">系统登录</h1>
			<form class="form-horizontal templatemo-container templatemo-login-form margin-bottom-30" id="ajaxForm" onsubmit="return false;">
				{$#if Has(SR.Var("web_msg"))}
				<div class="form-group">
				  <div class="col-xs-12"><div class="alert alert-danger" role="alert">
				  <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
				  <span class="sr-only">Error:</span>{$web_msg}</div></div>
				</div>
				{$/#if}
		        <div class="form-group">
		          <div class="col-xs-12">		            
		            <div class="control-wrapper">
		            	<label for="user" class="control-label fa-label"><i class="glyphicon glyphicon-user"></i></label>
		            	<input type="text" class="form-control" id="user" name="user" autocomplete="off" placeholder="请输入账号">
		            </div>		            	            
		          </div>              
		        </div>
		        <div class="form-group">
		          <div class="col-md-12">
		          	<div class="control-wrapper">
		            	<label for="pwd" class="control-label fa-label"><i class="glyphicon glyphicon-lock"></i></label>
		            	<input type="password" class="form-control" id="pwd" name="pwd" placeholder="请输入密码">
		            </div>
		          </div>
		        </div>
		        <!--<div class="form-group">
		          <div class="col-md-12">
	             	<div class="checkbox control-wrapper">
	                	<label>
	                  		<input type="checkbox"> Remember me
                		</label>
	              	</div>
		          </div>
		        </div>-->
		        <div class="form-group">
		          <div class="col-md-12">
		          	<div class="control-wrapper">
		          		<input type="button" id="btnAjaxSubmit" value="登 录" class="btn btn-info">
		          		<!--<a href="forgot-password.html" class="text-right pull-right">忘记密码？</a>-->
		          	</div>
		          </div>
		        </div>
				<hr>
		        <div class="form-group">
		          <div class="col-md-12">
	             	<div class="control-wrapper"><label>
	                  	<input type="checkbox" onclick="$('#loginwithjyk').toggle()"> 使用其他账号登录
                	</label></div>
		          </div>
		        </div>
		        <div id="loginwithjyk" style="display:none;">
		        <div class="form-group">
		        	<div class="col-md-12">
		        		<label>Login with: </label>
		        		<div class="inline-block">
		        			<a href="#"><i class="fa fa-facebook-square login-with"></i></a>
			        		<a href="#"><i class="fa fa-twitter-square login-with"></i></a>
			        		<a href="#"><i class="fa fa-google-plus-square login-with"></i></a>
			        		<a href="#"><i class="fa fa-tumblr-square login-with"></i></a>
			        		<a href="#"><i class="fa fa-github-square login-with"></i></a>
		        		</div>
		        	</div>
		        </div>
		        </div>
		      </form>
			<form id="forml" method="post" action="{$__URL__}/verify">
				<input type="hidden" id="username" name="username">
				<input type="hidden" id="password" name="password">
			</form>
			<script>
			function actSubmit(){
				var state=true,msg=''; s_pwd='';
				if($('#user').val()==$('#user').attr('placeholder')||$('#user').val()==''){
					state=false; msg='请输入账号';
				}
				if($('#pwd').val()==$('#pwd').attr('placeholder')||$('#pwd').val()==''){
					state=false; msg='请输入密码';
				}
				if(state==true){
					for(var i=0;i<($('#pwd').val()).length;i++){s_pwd+='*';}
					$('#username').val($('#user').val());
					$('#password').val(md5($('#pwd').val()));$('#pwd').val(s_pwd);
					//$('#forml').submit();
					//演示页不提交
					alert('user: '+$('#username').val()+' ; pswd: '+$('#password').val()+' ;');
				}else{ alert(msg); }
			}
			$(function(){
				$('input[placeholder]').placeholder();
				$('#btnAjaxSubmit').click(function(){ actSubmit(); });
				$('#user').bind('keypress',function(event){ if(event.keyCode=='13'){actSubmit();} });
				$('#pwd').bind('keypress',function(event){ if(event.keyCode=='13'){actSubmit();} });
			});
			</script>
		</div>
		<div class="col-md-12" style="text-align:center;">版权所有 © All Rights Reserved.</div>
	</div>
</body>
</html>